<template>
  <div class="list" v-if="sclist.length>0">
    <router-link
      :to="{name:'detail',params: item }"
      class="item"
      v-for="(item,index) in sclist"
      :key="index"
    >
      <div class="img">
        <img :src="item.pic" alt />
      </div>
      <div class="text">
        <h4 class="name">{{item.name}}</h4>
        <div class="yx">月销：{{item.yx}}</div>
        <div class="qs">
          <span>起送￥{{item.qs}}</span>
          <span>{{item.km}}km</span>
        </div>
        <div class="mj">
          <span>{{item.xm}}减{{item.xmj}}</span>
          <span>{{item.zm}}减{{item.zmj}}</span>
          <span>{{item.dm}}减{{item.dmj}}</span>
        </div>
      </div>
    </router-link>
  </div>
  <div class="listin" v-else>
    <img src="../../../assets/hmy.png" alt />
  </div>
</template>

<script>
import { mapState } from "vuex";

export default {
  computed: {
    /* 拿到收藏数据并渲染 */
    ...mapState(["sclist"])
  }
};
</script>

<style>
</style>